import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooCodelabsAlgorithmController } from '../../../controllers';
const uctoocodelabsAlgorithmRouter = new Router();
const codelabsAlgorithmController = new uctooCodelabsAlgorithmController();

uctoocodelabsAlgorithmRouter.post('/add', requireUser, codelabsAlgorithmController.add);
uctoocodelabsAlgorithmRouter.post('/edit', requireUser, rowLevelPermission('uctoo/codelabs_algorithm'), codelabsAlgorithmController.edit);
uctoocodelabsAlgorithmRouter.post('/del', requireUser, rowLevelPermission('uctoo/codelabs_algorithm'), codelabsAlgorithmController.delete);

//For getting codelabsAlgorithm with permission control
uctoocodelabsAlgorithmRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/codelabs_algorithm'), codelabsAlgorithmController.getSingle);
uctoocodelabsAlgorithmRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/codelabs_algorithm'), codelabsAlgorithmController.getMany);
uctoocodelabsAlgorithmRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/codelabs_algorithm'), codelabsAlgorithmController.getMany);

//#endregion AutoCreateCode
export default uctoocodelabsAlgorithmRouter;
